package com.yidingdui.domain.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Resultdata<T> {
    private String code;
    private String msg;
    private T data;

    public static <T> Resultdata<T> success(T data) {
        return new Resultdata<T>("200", "成功", data);
    }

    public static <T> Resultdata<T> error(String code, String msg) {
        return new Resultdata<T>(code, msg, null);
    }
}
